import Layout from '@/layout'

const exampleRouter = [
  {
    path: '/example',
    component: Layout,
    redirect: '/example/table',
    name: 'Example',
    meta: { title: 'Example', icon: 'example' },
    children: [
      {
        path: 'table',
        name: 'Table',
        redirect: '/example/table/index',
        component: () => import('@/views/example/table/index'),
        meta: { title: 'Table', icon: 'table' },
        children: [
          {
            path: 'index',
            name: 'table-index',
            component: () => import('@/views/example/table/index/index'),
            meta: { title: '自定义表格一' }
          },
          {
            path: 'table',
            name: 'table-table',
            component: () => import('@/views/example/table/table/index'),
            meta: { title: '自定义表格二' }
          },
          {
            path: 'system',
            name: 'table-system',
            component: () => import('@/views/example/table/system/index'),
            meta: { title: '系统表格' }
          }
        ]
      },

      {
        path: 'tree',
        name: 'Tree',
        component: () => import('@/views/example/tree/index'),
        meta: { title: 'Tree', icon: 'tree' }
      },

      {
        path: 'form',
        name: 'Form',
        component: () => import('@/views/example/form/index'),
        meta: { title: 'Form', icon: 'form' }
      },

      {
        path: 'nested',
        redirect: '/nested/menu1',
        name: 'Nested',
        component: () => import('@/views/example/nested/index'),
        meta: { title: 'Nested', icon: 'nested' },
        children: [
          {
            path: 'menu1',
            component: () => import('@/views/example/nested/menu1/index'), // Parent router-view
            name: 'Menu1',
            meta: { title: 'Menu1' },
            children: [
              {
                path: 'menu1-1',
                component: () => import('@/views/example/nested/menu1/menu1-1'),
                name: 'Menu1-1',
                meta: { title: 'Menu1-1' }
              },
              {
                path: 'menu1-2',
                component: () => import('@/views/example/nested/menu1/menu1-2'),
                name: 'Menu1-2',
                meta: { title: 'Menu1-2' },
                children: [
                  {
                    path: 'menu1-2-1',
                    component: () => import('@/views/example/nested/menu1/menu1-2/menu1-2-1'),
                    name: 'Menu1-2-1',
                    meta: { title: 'Menu1-2-1' }
                  },
                  {
                    path: 'menu1-2-2',
                    component: () => import('@/views/example/nested/menu1/menu1-2/menu1-2-2'),
                    name: 'Menu1-2-2',
                    meta: { title: 'Menu1-2-2' }
                  }
                ]
              },
              {
                path: 'menu1-3',
                component: () => import('@/views/example/nested/menu1/menu1-3'),
                name: 'Menu1-3',
                meta: { title: 'Menu1-3' }
              }
            ]
          },
          {
            path: 'menu2',
            name: 'Menu2',
            component: () => import('@/views/example/nested/menu2/index'),
            meta: { title: 'menu2' }
          },

          {
            path: 'external-link',
            children: [
              {
                path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
                meta: { title: 'External Link', icon: 'link' }
              }
            ]
          }
        ]
      }

    ]
  }

]

export default exampleRouter
